/**
 * @date 2006-7-17
 */

package org.nanhill.xmlro.gsp.client;

import java.io.IOException;
import java.net.Socket;

import org.nanhill.xmlro.gsp.GspException;
import org.nanhill.xmlro.gsp.GspTransport;

/**
 * @author alin [xalinx at gmail dot com]
 * @date 2006-7-17
 */
abstract class AbstractGspAgent implements GspAgent {
	protected GspTransport transport = new GspTransport();

	protected String slsModuleName;

	protected String serviceName;

	protected String serviceVersion;

	protected String serviceHost;

	protected int servicePort;

	protected Socket serviceSocket;

	protected String slsHost;

	protected int slsPort;

	public void setSlsModuleName(String slsModuleName) {
		this.slsModuleName = slsModuleName;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.nanhill.xmlro.gsp.GspAgent#addSLSTarget(java.lang.String, int)
	 */
	public void addSLSTarget(String host, int port) {
		this.slsHost = host;
		this.slsPort = port;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.nanhill.xmlro.gsp.GspAgent#setServiceType(java.lang.String,
	 *      java.lang.String)
	 */
	public void setServiceType(String serviceName, String version)
			throws GspException, IOException {
		this.serviceName = serviceName;
		this.serviceVersion = version;
	}

	public void setServiceHost(String host) {
		this.serviceHost = host;

	}

	public void setServicePort(int port) {
		this.servicePort = port;
	}

	public String getServiceHost() {
		return serviceHost;
	}

	public int getServicePort() {
		return servicePort;
	}

}
